package com.acme.bankapp.service.email;

import java.io.*;

import com.acme.bankapp.domain.bank.*;

/**
 * Class stores client and email information
 * @author alex
 */
@SuppressWarnings("serial")
public class Email implements Serializable {
	private Client client;
	private String emailAddress;
	
	/**
	 * @param client the client
	 * @param emailAddress the email address
	 */
	public Email(Client client, String emailAddress) {
		this.client = client;
		this.emailAddress = emailAddress;
	}
	
	/**
	 * @return the client
	 */
	public Client getClient() {
		return client;
	}
	
	/**
	 * @param client the client
	 */
	public void setClient(Client client) {
		this.client = client;
	}
	
	/**
	 * @return the email address
	 */
	public String getEmailAddress() {
		return emailAddress;
	}
	
	/**
	 * @param emailAddress the email address
	 */
	public void setEmailAddress(String emailAddress) {
		this.emailAddress = emailAddress;
	}
	
	/**
	 * @return the string presentation
	 */
	@Override
	public String toString() {
		return this.client.getGender().getSalutation() + this.client.getName() + " <" + this.emailAddress + ">";
	}
}
